package com.example.trafficsystem.service;

import com.example.trafficsystem.entity.Task;
import com.example.trafficsystem.entity.TrainingDocument;
import com.example.trafficsystem.repository.TaskRe;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TaskService {
    @Autowired
    private TaskRe taskRepository;
    //获取培训计划中的任务点
    public List<Task> findDocumentsByTrainingPlan(Long trainingPlanId) {
        return taskRepository.findAllByTrainingPlanId(trainingPlanId);

    }
    //根据任务点id查找任务点
    public Task findDocumentById(Long documentId) {
        return taskRepository.findById(documentId).orElse(null);

    }


}
